import redis #导入redis包包

#与本地redis进行链接，地址为：localhost，端口号为6379
r=redis.StrictRedis(host='localhost',port=6379)
print(r.set("Hello","World"))#SET命令执行成功，会返回OK，在Python中返回True

print(r.get("Hello"))  #获取指定键【Hello】对应的值

r.delete("Hello")  #删除

print(r.get("Hello"))
